/******************** (C) COPYRIGHT 2009 Embest Info&Tech Co.,LTD. *************
* File Name          : stm32f10x_it.c
* Author             : Wuhan R&D Center, Embest
* Date First Issued  : 07/12/2009
* Description        : Main Interrupt Service Routines.
*             		   This file provides template for all exceptions handler
*                      and peripherals interrupt service routine.
*******************************************************************************/

/* Includes ------------------------------------------------------------------*/

#include "stm32f10x_it.h"
#include "usb_lib.h"
#include "usb_istr.h"
#include <stdio.h>

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static volatile uint32_t tim2_cnt = 0;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/


/******************************************************************************/
/*            STM32F10x Peripherals Interrupt Handlers                        */
/******************************************************************************/

void startTimer_1ms(void)
{
	tim2_cnt = 0;
}

uint32_t endTimer_1ms(void)
{
	return tim2_cnt;
}

void TIM2_IRQHandler(void)
{
	tim2_cnt++;

	if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
	{
		TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
	}
}


/************* (C) COPYRIGHT 2009 Wuhan R&D Center, Embest *****END OF FILE****/
